from time import sleep
import win32gui
import win32api
import sys
import random
def xxreq(rowid,win_name):
		randTime=random.randint(2,6)
		sleep(randTime)
		hWndList = []
		win32gui.EnumWindows(lambda hWnd, param: param.append(hWnd), hWndList)
		for hwnd in hWndList:			
				clsname = win32gui.GetClassName(hwnd)
				title = win32gui.GetWindowText(hwnd)
				if title == "abcd":
					print(f"hwnd:{hwnd}|clsname:{clsname}|title:{title}")
					# if (title.find(win_name) >= 0):
					#		 win32api.PostMessage(hwnd, 1600, int(rowid), randTime)

if __name__ == '__main__':
		xxreq("","")
	
		# xxreq(sys.argv[1], sys.argv[2])

